﻿<local:DocumentBase x:Class="WPFExcelReport.AB50"
           xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
          xmlns:local="clr-namespace:ReflectionStudio.Components.UserControls;assembly=ReflectionStudio.Core"
                xmlns:fd="clr-namespace:Labs.Filtering;assembly=ReflectionStudio.Core"
        xmlns:wep="clr-namespace:WPFExcelReport"
       Height="700" Width="1024" Background="White"
          
         Loaded="Window_Loaded"
        Title="AB50"  
     >
    <local:DocumentBase.Resources>
    </local:DocumentBase.Resources>
    <Grid DataContext="{Binding}">
        <Grid.RowDefinitions>
            <RowDefinition Height="100" />
            <RowDefinition Height="150*" />
            <RowDefinition Height="200*" />
            <RowDefinition Height="50*" />
        </Grid.RowDefinitions>
        <Grid.ColumnDefinitions>
            <ColumnDefinition Width="100*"></ColumnDefinition>
            <ColumnDefinition Width="100*"></ColumnDefinition>
        </Grid.ColumnDefinitions>
        <StackPanel Grid.Row="0" Grid.Column="0" Grid.ColumnSpan="2" Orientation="Horizontal">
            <Button Content="生成报表" Height="40" Margin="60,10,0,0"  Name="btnQuery" Width="90" Click="btnQuery_Click"/>
            <TextBlock FontSize="18"  Height="40"   Width="59" Name="txt1" Margin="30,10,0,0" Text="生产单" />
            <TextBlock FontSize="18"  Height="36"   Width="47" Name="txtABPAUFKRS" Margin="30,10,0,0" Text="" />
            <TextBlock  FontSize="18" Height="36"    Width="130" Name="txtABPAUFLFD"   Margin="30,10,0,0"    Text="" />
        </StackPanel>
        <fd:FilteringDataGrid  Grid.Row="1" CanUserReorderColumns="True"  
          CanUserResizeRows="True" CanUserSortColumns="True"
            IsFilteringCaseSensitive="False"
            AutoGenerateColumns="False"   
                  EnableRowVirtualization="True"  
                  RowDetailsVisibilityMode="VisibleWhenSelected"  
                               Height="Auto" HorizontalAlignment="Stretch" VerticalAlignment="Stretch"
                                IsSynchronizedWithCurrentItem="True" Opacity="10" Visibility="Visible"
                               ItemsSource="{Binding Path=ABPOS}" x:Name="ABPOSDataGrid" 
                               SelectionChanged="MainDataGrid_SelectionChanged" Grid.ColumnSpan="2">
            <fd:FilteringDataGrid.Columns>
                <DataGridTextColumn Header="加工厂" Binding="{Binding FACTORY}"/>
                <DataGridTextColumn Header="生" Binding="{Binding Path=ABPAUFKRS}"/>
                <DataGridTextColumn Header="产" Binding="{Binding ABPAUFLFD}"/>
                <DataGridTextColumn Header="单" Binding="{Binding ABPAUFPOS}"/>
                <DataGridTextColumn Header="品种" Binding="{Binding ABPART}"/>
                <DataGridTextColumn Header="版本" Binding="{Binding ABPVAR}"/>
                <DataGridTextColumn Header="色号" Binding="{Binding ABPFARBE}"/>
                <DataGridTextColumn Header="数量" Binding="{Binding WEI}"/>
                <DataGridTextColumn Header="开单日期" Binding="{Binding ABPNEUDAT}"/>
                <DataGridTextColumn Header="开始" Binding="{Binding ABPSTARTDAT}"/>
                <DataGridTextColumn Header="交期" Binding="{Binding ABPENDDAT}"/>
                <DataGridTextColumn Header="布号" Binding="{Binding FABRIC}"/>
                <DataGridTextColumn Header="用途" Binding="{Binding USAGE}"/>
                <DataGridTextColumn Header="缸号" Binding="{Binding ABPLTVORL}"/>
                <DataGridTextColumn Header="行备注" Binding="{Binding REMARK}"/>
            </fd:FilteringDataGrid.Columns>
        </fd:FilteringDataGrid  >
        <fd:FilteringDataGrid  Grid.Row="2" CanUserReorderColumns="True"  
          CanUserResizeRows="True" CanUserSortColumns="True"
            IsFilteringCaseSensitive="False"
            AutoGenerateColumns="False"   
                  EnableRowVirtualization="True"  
                  RowDetailsVisibilityMode="VisibleWhenSelected" HorizontalAlignment="Stretch" VerticalAlignment="Stretch"
                               ItemsSource="{Binding Path=GAAUF}" x:Name="listGAAUF" 
                             IsSynchronizedWithCurrentItem="False" Opacity="10" Visibility="Visible" Grid.RowSpan="2">
            <fd:FilteringDataGrid.Columns>
                <DataGridTextColumn Header="纱线"  Width="80" Binding="{Binding GAART}"/>
                <DataGridTextColumn Header="版本" Binding="{Binding GAVAR}"/>
                <DataGridTextColumn Header="色号" Binding="{Binding GAFARBE}"/>
                <DataGridTextColumn Header="需求" Binding="{Binding GAKG1}"/>
                <DataGridTextColumn Header="留位" Binding="{Binding GAKG3}"/>
            </fd:FilteringDataGrid.Columns>
        </fd:FilteringDataGrid  >
        <TextBlock Grid.Column="1" Grid.Row="2" HorizontalAlignment="Right" TextAlignment="Left"
                   Name="textBlock1" Text="{Binding ElementName=ABPOSDataGrid, Path=SelectedItem.COMMENTS}" Grid.RowSpan="2" Width="501" />
    </Grid>
</local:DocumentBase>
